const webpack = require("webpack")
const path = require('path')

// 使用dll技术, 对某些库(第三方库: jquery, react, vue...)进行单独打包
module.exports = {
  mode: 'production',
  entry: {
    jquery: ['jquery']
  },
  output: {
    filename: '[name].js',
    path: path.resolve(__dirname, '../dll'),
    library: '[name]_[hash]'
  },
  plugins: [
    new webpack.DllPlugin({
      // 与library相同
      name: '[name]_[hash]',
      path: path.resolve(__dirname, '../dll/manifest.json')
    })
  ]
}